package org.truenewx.tnxjeex.unit.model;

import javax.measure.quantity.Dimensionless;

import org.truenewx.tnxjee.core.Strings;
import org.truenewx.tnxjee.core.caption.Caption;
import org.truenewx.tnxjee.core.enums.annotation.EnumConstantScene;
import org.truenewx.tnxjee.core.enums.annotation.EnumSubTypeCaption;
import org.truenewx.tnxjee.core.enums.annotation.SimpleEnumType;
import org.truenewx.tnxjeex.unit.support.MeasureUnits;
import org.truenewx.tnxjeex.unit.util.UnitScenes;
import org.truenewx.tnxjeex.unit.util.UnitTypes;
import tech.units.indriya.AbstractUnit;

/**
 * 数量单位
 */
@Caption("数量单位")
@SimpleEnumType(name = UnitTypes.QUANTITY)
@EnumSubTypeCaption(subname = UnitScenes.QUANTITY_KILO, caption = "千进制数量单位")
@EnumSubTypeCaption(subname = UnitScenes.QUANTITY_WAN, caption = "万进制数量单位")
public interface QuantityUnit extends MeasureUnit<Dimensionless> {

    @Caption("个")
    @EnumConstantScene(subType = UnitScenes.QUANTITY_KILO)
    @EnumConstantScene(subType = UnitScenes.QUANTITY_WAN)
    QuantityUnit ONE = MeasureUnits.getInstance().add(AbstractUnit.ONE, QuantityUnit.class, Strings.SPACE, "ONE", "Q1");

    @Caption("千")
    @EnumConstantScene(subType = UnitScenes.QUANTITY_KILO)
    QuantityUnit KILO = MeasureUnits.getInstance().multiply(ONE, 1000, "K", "KILO", "QK");

    @Caption("百万")
    @EnumConstantScene(subType = UnitScenes.QUANTITY_KILO)
    QuantityUnit MILLION = MeasureUnits.getInstance().multiply(KILO, 1000, "M", "MILLION", "QM");

    @Caption("十亿")
    @EnumConstantScene(subType = UnitScenes.QUANTITY_KILO)
    QuantityUnit BILLION = MeasureUnits.getInstance().multiply(MILLION, 1000, "B", "BILLION", "QB");

    @Caption("万")
    @EnumConstantScene(subType = UnitScenes.QUANTITY_WAN)
    QuantityUnit WAN = MeasureUnits.getInstance().multiply(ONE, 10000, "W", "WAN", "QW");

    @Caption("亿")
    @EnumConstantScene(subType = UnitScenes.QUANTITY_WAN)
    QuantityUnit YI = MeasureUnits.getInstance().multiply(WAN, 10000, "Y", "YI", "QY");

}
